<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://"
			+ request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html lang="zh-CN">
<head>
<link rel="stylesheet" href="<%=path%>/css/manager/users.css">
<script type="text/javascript" src="<%=path%>/js/manager/jquery-1.8.2.js"></script>
<title>用户列表</title>
</head>
<body>
   <input type="hidden" id="sysuserType" value="${sysuserlogin.sysuserType}"/>
	<!--
        	作者：offline
        	时间：2016-12-22
        	描述：用户管理
        -->
		<div class="bbs_mist_div1">用户管理</div>
		<form action="tosyslist.htm" id="sform" method="post">
   			<input type="hidden" id="adduserid" name="adduserid" value="${back_user.sysuserId}"/>
			<div class="news_div2">
	        	<input class="news_div2_in1" type="text" placeholder="搜索用户姓名、部门、职位" id="condition" name="condition" value="${sysuser.condition}"/>
	        	<input class="news_div2_in2" type="button" value="查找" onclick="checksubmit()"/>
	        </div>
        </form>
        <div class="bbs_mist_div2">
     	    <c:if test="${sysuserlogin.sysuserType==1}">
        		<input class="bbs_mist_div2_in1" type="button" onclick="tomanage(1,0)"/>
        	</c:if>
        	<div class="bbs_mist_div2_div1">
        		<div class="bbs_mist_div2_div1_div1">用户</div>
        		<div class="bbs_mist_div2_div1_div5">帐号</div>
        		<div class="bbs_mist_div2_div1_div2">工作地点</div>
        		<div class="bbs_mist_div2_div1_div3">联系方式</div>
        		<c:if test="${sysuserlogin.sysuserType==1}">
	        		<div class="bbs_mist_div2_div1_div4">操作</div>
        		</c:if>
        	</div>
        	<div class="bbs_mist_div2_div2">
        		<c:forEach items="${list}" var="sysuserlist" >
	        		<div class="bbs_mist_div2_div2_div1">
	        		
	        			<div class="<c:if test="${sysuserlist.sysuserType==0}">bbs_mist_div2_div2_div1_div1</c:if><c:if test="${sysuserlist.sysuserType==1}">bbs_mist_div2_div2_div1_div1s</c:if>">
	        				<a href="###">${sysuserlist.sysuserUsername}</a>
	        				<span>${sysuserlist.sysuserDepartment}</span>
	        				<span>${sysuserlist.sysuserJob}</span>
	        			</div>
	        			<div class="bbs_mist_div2_div2_div1_div5">${sysuserlist.sysuserName}</div>
	        			<div class="bbs_mist_div2_div2_div1_div2">${sysuserlist.sysuserAddress}</div>
	        			<div class="bbs_mist_div2_div2_div1_div3">${sysuserlist.sysuserTel}</div>
	        			<c:if test="${sysuserlogin.sysuserType==1}">
		        			<div class="bbs_mist_div2_div2_div1_div4">
		        				<%-- <a href="###" onclick="tomanage(3,'${sysuserlist.sysuserId}')">查看</a> --%>
		        				<a href="###" onclick="tomanage(2,'${sysuserlist.sysuserId}')">编辑</a>
		        				<a href="###" onclick="tomanage(4,'${sysuserlist.sysuserId}')">删除</a>
		        			</div>
        				</c:if>
	        		</div>
        		</c:forEach>
        	</div>
        	<!--<div class="bbs_mist_div2_div3">
        		<select>
        			<option>10</option>
        			<option>20</option>
        			<option>30</option>
        		</select>
        		<span>/每页，共7条记录</span>
        	</div>-->
        </div>
</body>
<script>
	$(function(){
		var $indexs=$(".bbs_mist_div2_div2_div1").length;
		for(var i=0;i<$indexs;i++){
			
			if(i%2==0){
				$(".bbs_mist_div2_div2_div1").eq(i).css({"background":"#fff"})
			}else{
				$(".bbs_mist_div2_div2_div1").eq(i).css({"background":"#f3f3f3"})
			}
		}
	})
</script>
<script type="text/javascript">
//去编辑页面:type:1.添加；2：编辑；3：查看;4删除 id管理员id
function tomanage(type,id){
	var adduserid=$("#adduserid").val();
	//alert(adduserid);
	if(type==4){
		if(window.confirm("确定要删除该管理员信息吗？")){
			window.location.href="<%=path%>/userctr/managesysuser.htm?markManage="+type+"&sysuserId="+id+"&adduserid="+adduserid;
		}
	}else{
			window.location.href="<%=path%>/userctr/tomanagesysuser.htm?markManage="+type+"&sysuserId="+id+"&adduserid="+adduserid;
	}
}
//提交验证
function checksubmit(){
	//alert("123");
	var condition=$.trim($("#condition").val());
	$("#condition").val(condition);
	//alert(condition);
	$("#sform").submit();
	}
</script>
</html>

